Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hyper-v platform] Delete disks on deletion of VM #3616

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SRIKKANTH
Copy link
Collaborator

When a VM is deleted, its attached disks are not automatically removed, which can lead to disk space issues. This change will address the problem by ensuring that both the OS and data disks attached to the VM are deleted across all storage controllers on VM deletion.

lisa/tools/hyperv.py Outdated Show resolved Hide resolved
@SRIKKANTH
Copy link
Collaborator Author

@LiliDeng please let me know if anything is needed on this.

# above command returns a list of disks if there are multiple disks.
# if there is only one disk, it returns a single disk but not a list.
# so convert the output to a list if it is not already a list
if not isinstance(output, List):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not output:
    return []
if not isinstance(output, list):
    output = [output]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LiliDeng Please let me know if anything more is needed on this?

When a VM is deleted, its attached disks are not automatically removed, which can lead to disk space issues. This change will address the problem by ensuring that both the OS and data disks attached to the VM are deleted across all storage controllers on VM deletion.
@SRIKKANTH SRIKKANTH force-pushed the smyakam/hyperv/cleanup_improvements_26_01_2025 branch from 85ca87b to 0ed59d4 Compare February 2, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants